<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>切换场馆</title>
    <script src="js/flexible.js"></script>
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="js/vue/vue.js"></script>
    <script src="js/vue/axios.js"></script>
    <script src="js/vue/MD5.js"></script>
</head>
<body>
    <div class="xzmd_main" id="app">
        <template>
            <div class="md_list" v-for="item in list" @click="select(item.Gtoken,item.id)">
                <img :src="item.Logo" onerror="this.src='images/shopMoren.jpg'">
                <br>
                <span>{{item.Vname}}</span>
            </div>
        </template>
        <!-- <div class="md_list md_check">
            <img src="images/banner.png" alt="门店图片">
            <br>
            <span>龙采健身会所</span>
        </div> -->
    </div>
</body>
<script>
var app = new Vue({
    el: '#app',
    data: {
       list:[]
    },
    created(){
        this.getlists()
    },
    methods: {
        getlists(){
            this.vids=sessionStorage.getItem('Vid')
            //console.log(this.vids)
            getVs()
            axios.get('/mobileapi/member/user_other.php?act=switch_venues').then(data =>{
                console.log(data.data)
                let { msg, code,user} = data.data
                    if (code !== 200) {
                        _this.$message({
                            message: msg,
                            type: 'error'
                        });
                    } else {
                        //window.vant.Toast.clear();
                        data=data.data
                        this.list=data.data
                        for(let i in this.list){
                            if(this.list[i].Picurl==null||this.list[i].Picurl==''){
                                this.list[i].Picurl='images/shopMoren.jpg'
                            }
                        }
                    }
                }).catch(function (error) {
                    console.log(error); 
            })
        },
        select(Gtoken,Vid){
            sessionStorage.setItem('token',Gtoken)
            sessionStorage.setItem('Vid',Vid)
            //跳转到首页
            let type="logo"
            sessionStorage.setItem('type',type)
            window.location.href='index.html?vid='+Vid+'&type='+type+''
        }
    }  
})    
</script>
</html>